struct Solution {}

fn main() {}

impl Solution {
    pub fn generate(num_rows: i32) -> Vec<Vec<i32>> {
        let mut ret: Vec<Vec<i32>> = vec![];
        for row in 1..=num_rows {
            if row == 1 {
                ret.push(vec![1]);
                continue;
            }
            if row == 2 {
                ret.push(vec![1, 1]);
                continue;
            }
            let mut row_vec = vec![1];
            for num_cnt in 0..(row - 2) {
                row_vec.push(ret[(row - 2) as usize][(num_cnt + 1) as usize] + ret[(row - 2) as usize][(num_cnt) as usize]);
            }
            row_vec.push(1);
            ret.push(row_vec);
        }
        ret
    }
}